package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.Sceneryspot;
import com.ruoyi.system.mapper.SceneryspotMapper;
import com.ruoyi.system.service.ISceneryspotService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 景点Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-10-15
 */
@Service
public class SceneryspotServiceImpl implements ISceneryspotService 
{
    @Autowired
    private SceneryspotMapper sceneryspotMapper;

    /**
     * 查询景点
     * 
     * @param id 景点ID
     * @return 景点
     */
    @Override
    public Sceneryspot selectSceneryspotById(Long id)
    {
        return sceneryspotMapper.selectSceneryspotById(id);
    }

    /**
     * 查询景点列表
     * 
     * @param sceneryspot 景点
     * @return 景点
     */
    @Override
    public List<Sceneryspot> selectSceneryspotList(Sceneryspot sceneryspot)
    {
        return sceneryspotMapper.selectSceneryspotList(sceneryspot);
    }

    /**
     * 新增景点
     * 
     * @param sceneryspot 景点
     * @return 结果
     */
    @Override
    public int insertSceneryspot(Sceneryspot sceneryspot)
    {
        sceneryspot.setCreateTime(DateUtils.getNowDate());
        return sceneryspotMapper.insertSceneryspot(sceneryspot);
    }

    /**
     * 修改景点
     * 
     * @param sceneryspot 景点
     * @return 结果
     */
    @Override
    public int updateSceneryspot(Sceneryspot sceneryspot)
    {
        sceneryspot.setUpdateTime(DateUtils.getNowDate());
        return sceneryspotMapper.updateSceneryspot(sceneryspot);
    }

    /**
     * 删除景点对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSceneryspotByIds(String ids)
    {
        return sceneryspotMapper.deleteSceneryspotByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除景点信息
     * 
     * @param id 景点ID
     * @return 结果
     */
    @Override
    public int deleteSceneryspotById(Long id)
    {
        return sceneryspotMapper.deleteSceneryspotById(id);
    }
}
